//#include<iostream>
//#include<string>
//
//using namespace std;
//
//#include<unistd.h>
//#include<sys/wait.h>
//#include<sys/types.h>
//
//#include<pthread.h>
//
//
//
//int main()
//{
//  string s;
//  if(s.c_str() == nullptr)
//  {
//    cout << "TRUE" << endl;
//  }
//  else 
//  {
//    cout << "false" << endl;
//  }
//
//
//  if(fork() == 0)
//  {
//    cout << "子进程替换中" << endl;
//    sleep(1);
//    //execl("/usr/bin/ls", "ll", "-l", nullptr);
//    
//    // Both of the following usage are correct
//    // The second arguments can have no ./
//    execl("./Code", "./Code", nullptr);
//    execl("./Code", "Code", nullptr);
//    cout << "替换失败" << endl;
//    exit(1);
//  }
//
//  cout << "father start to wait" << endl;
//  int status = 0;
//  pid_t pid = waitpid(-1, &status, 0); // 子进程替换之后pid是不变的，还需要父进程进行等待
//  cout << "father wait [" << pid << "] success" << endl;
//  if(WIFEXITED(status))
//  {
//    cout << "child exit code::" << WEXITSTATUS(status) << endl;
//  }
//  
//
//  while(1)
//  {
//    cout << "father running" << endl;
//    sleep(1);
//  }
//
//  return 0;
//}
//

////void* CallBack(void* args)
////{
////  args = 0;
////  pid_t pid = fork();
////  if(pid == 0)
////  { // child
////    cout << "child process created" << endl;
////    sleep(5);
////    cout << "child process quit" << endl;
////  }
////  else 
////  { // father
////    cout << "child thread doning" << endl;
////    sleep(3);
////    cout << "child thread quit" << endl;
////  }
////
////  return nullptr;
////}
////
////int main()
////{
////  pthread_t tid;
////  pthread_create(&tid, nullptr, CallBack, nullptr);
////
////  while(1)
////  {
////    cout << "main thread running" << endl;
////    sleep(1);
////  }
////
////  pthread_join(tid, nullptr);
////
////  return 0;
////}
//
////int main()
////{
////  string str1 = "GET";
////  string str2 = "POST";
////  string str3 = "asdb";
////
////  if(str1 != "GET" && str1 != "POST")
////  {
////    cout << str1 << endl;
////  }
////
////  if(str2 != "GET" && str2 != "POST")
////  {
////    cout << str2 << endl;
////  }
////
////  if(str3 != "GET" && str3 != "POST")
////  {
////    cout << str3 << endl;
////  }
////
////
////  if(str1 != "GET" || str1 != "POST")
////  {
////    cout << "||" << str1 << endl;
////  }
////
////  if(str2 != "GET" || str2 != "POST")
////  {
////    cout << "||" << str2 << endl;
////  }
////
////  if(str3 != "GET" || str3 != "POST")
////  {
////    cout << "||" << str3 << endl;
////  }
////
////
////  return 0;
////}
//
#include<iostream>
using namespace std;


class A
{
public:
	int _a;
};

class B : virtual public A
{
public:
	int _b;
};

class C : public virtual A
{
public:
	int _c;
};

class D : public B, public C
{
public:
	int _d;
};

int tmp = 10;
int un;

int main()
{
	D d;

	d.B::_a = 10;
	d._b = 20;

	d.C::_a = 30;
	d._c = 40;

	d._d = 50;

	int* ptr = (int*)&d;

	int* heap = new int;
	int a = 0;

    const char* p = "awfead";

	printf("类地址  %#X\n", (unsigned long)&d);
	printf("栈地址  %#X\n", (unsigned long)&a);
	printf("堆地址  %#X\n", (unsigned long)heap);
	printf("初静地址%#X\n", (unsigned long)&tmp);
	printf("未静地址%#X\n", (unsigned long)&un);
	printf("串地址  %#X\n", (unsigned long)p);
	printf("虚基表  %#X\n", *ptr);


	return 0;
}
